import muBan from './myCanvas';
export default (myCanvas, height, weight) => {
  var color = '#007FFF';
  var color_ = '#000000';

  var font = '12px Arial';
  var font2 = '30px Microsoft YaHei';
  var a = [
    '2',
    '3',
    '4',
    '5',
    '6',
    '7',
    '8',
    '9',
    '10',
    '11',
    '12',
    '13',
    '14',
    '15',
    '16',
    '17',
    '18岁',
  ];
  var l = [
    '190',
    '180',
    '170',
    '160',
    '150',
    '140',
    '130',
    '120',
    '110',
    '100',
    '90',
    '80',
    '20',
    '10',
  ];
  var r = ['190', '180', '170', '160', '150', '90', '80', '70', '60', '50', '40', '30', '20', '10'];
  var t = '身高(cm)';
  var b = '体重(kg)';
  var title = '中国2~18岁男童身高、体重百分位曲线图';
  var arr_h_3 = [
    [2, 82.1],
    [2.5, 86.4],
    [3, 89.7],
    [3.5, 93.4],
    [4, 96.7],
    [4.5, 100],
    [5, 103.3],
    [5.5, 106.4],
    [6, 109.1],
    [6.5, 111.7],
    [7, 114.6],
    [7.5, 117.4],
    [8, 119.9],
    [8.5, 122.3],
    [9, 124.6],
    [9.5, 126.7],
    [10, 128.7],
    [10.5, 130.7],
    [11, 132.9],
    [11.5, 135.3],
    [12, 138.1],
    [12.5, 141.1],
    [13, 145],
    [13.5, 148.8],
    [14, 152.3],
    [14.5, 155.3],
    [15, 157.5],
    [15.5, 159.1],
    [16, 159.9],
    [16.5, 160.5],
    [17, 160.9],
    [18, 161.3],
  ];
  var arr_h_10 = [
    [2, 84.1],
    [2.5, 88.6],
    [3, 91.9],
    [3.5, 95.7],
    [4, 99.1],
    [4.5, 102.4],
    [5, 105.8],
    [5.5, 109],
    [6, 111.8],
    [6.5, 114.5],
    [7, 117.6],
    [7.5, 120.5],
    [8, 123.1],
    [8.5, 125.6],
    [9, 128],
    [9.5, 130.3],
    [10, 132.3],
    [10.5, 134.5],
    [11, 136.8],
    [11.5, 139.5],
    [12, 142.5],
    [12.5, 145.7],
    [13, 149.6],
    [13.5, 153.3],
    [14, 156.7],
    [14.5, 159.4],
    [15, 161.4],
    [15.5, 162.9],
    [16, 163.6],
    [16.5, 164.2],
    [17, 164.5],
    [18, 164.9],
  ];
  var arr_h_25 = [
    [2, 86.2],
    [2.5, 90.8],
    [3, 94.2],
    [3.5, 98],
    [4, 101.4],
    [4.5, 104.9],
    [5, 108.4],
    [5.5, 111.7],
    [6, 114.6],
    [6.5, 117.4],
    [7, 120.6],
    [7.5, 123.6],
    [8, 126.3],
    [8.5, 129],
    [9, 131.4],
    [9.5, 133.9],
    [10, 136],
    [10.5, 138.3],
    [11, 140.8],
    [11.5, 143.7],
    [12, 147],
    [12.5, 150.4],
    [13, 154.3],
    [13.5, 157.9],
    [14, 161],
    [14.5, 163.6],
    [15, 165.4],
    [15.5, 166.7],
    [16, 167.4],
    [16.5, 167.9],
    [17, 168.2],
    [18, 168.6],
  ];
  var arr_h_50 = [
    [2, 88.5],
    [2.5, 93.3],
    [3, 96.8],
    [3.5, 100.6],
    [4, 104.1],
    [4.5, 107.7],
    [5, 111.3],
    [5.5, 114.7],
    [6, 117.7],
    [6.5, 120.7],
    [7, 124],
    [7.5, 127.1],
    [8, 130],
    [8.5, 132.7],
    [9, 135.4],
    [9.5, 137.9],
    [10, 140.2],
    [10.5, 142.6],
    [11, 145.3],
    [11.5, 148.4],
    [12, 151.9],
    [12.5, 155.6],
    [13, 159.5],
    [13.5, 163],
    [14, 165.9],
    [14.5, 168.2],
    [15, 169.8],
    [15.5, 171],
    [16, 171.6],
    [16.5, 172.1],
    [17, 172.3],
    [18, 172.7],
  ];
  var arr_h_75 = [
    [2, 90.9],
    [2.5, 95.9],
    [3, 99.4],
    [3.5, 103.2],
    [4, 106.9],
    [4.5, 110.5],
    [5, 114.2],
    [5.5, 117.7],
    [6, 120.9],
    [6.5, 123.9],
    [7, 127.4],
    [7.5, 130.7],
    [8, 133.7],
    [8.5, 136.6],
    [9, 139.3],
    [9.5, 142],
    [10, 144.4],
    [10.5, 147],
    [11, 149.9],
    [11.5, 153.1],
    [12, 157],
    [12.5, 160.8],
    [13, 164.8],
    [13.5, 168.1],
    [14, 170.7],
    [14.5, 172.8],
    [15, 174.2],
    [15.5, 175.2],
    [16, 175.8],
    [16.5, 176.2],
    [17, 176.4],
    [18, 176.7],
  ];
  var arr_h_90 = [
    [2, 93.1],
    [2.5, 98.2],
    [3, 101.8],
    [3.5, 105.7],
    [4, 109.3],
    [4.5, 113.1],
    [5, 116.9],
    [5.5, 120.5],
    [6, 123.7],
    [6.5, 126.9],
    [7, 130.5],
    [7.5, 133.9],
    [8, 137.1],
    [8.5, 140.1],
    [9, 142.9],
    [9.5, 145.7],
    [10, 148.2],
    [10.5, 150.9],
    [11, 154],
    [11.5, 157.4],
    [12, 161.5],
    [12.5, 165.5],
    [13, 169.5],
    [13.5, 172.7],
    [14, 175.1],
    [14.5, 176.9],
    [15, 178.2],
    [15.5, 179.1],
    [16, 179.5],
    [16.5, 179.9],
    [17, 180.1],
    [18, 180.4],
  ];
  var arr_h_97 = [
    [2, 95.3],
    [2.5, 100.5],
    [3, 104.1],
    [3.5, 108.1],
    [4, 111.8],
    [4.5, 115.7],
    [5, 119.6],
    [5.5, 123.3],
    [6, 126.6],
    [6.5, 129.9],
    [7, 133.7],
    [7.5, 137.2],
    [8, 140.4],
    [8.5, 143.6],
    [9, 146.5],
    [9.5, 149.4],
    [10, 152],
    [10.5, 154.9],
    [11, 158.1],
    [11.5, 161.7],
    [12, 166],
    [12.5, 170.2],
    [13, 174.2],
    [13.5, 177.2],
    [14, 179.4],
    [14.5, 181],
    [15, 182],
    [15.5, 182.8],
    [16, 183.2],
    [16.5, 183.5],
    [17, 183.7],
    [18, 183.9],
  ];

  var arr_w_3 = [
    [2, 10.22],
    [2.5, 11.11],
    [3, 11.94],
    [3.5, 12.73],
    [4, 13.52],
    [4.5, 14.37],
    [5, 15.26],
    [5.5, 16.09],
    [6, 16.8],
    [6.5, 17.53],
    [7, 18.48],
    [7.5, 19.43],
    [8, 20.32],
    [8.5, 21.18],
    [9, 22.04],
    [9.5, 22.95],
    [10, 23.89],
    [10.5, 24.96],
    [11, 26.21],
    [11.5, 27.59],
    [12, 29.09],
    [12.5, 30.74],
    [13, 32.82],
    [13.5, 35.03],
    [14, 37.36],
    [14.5, 39.53],
    [15, 41.43],
    [15.5, 43.05],
    [16, 44.28],
    [16.5, 45.3],
    [17, 46.04],
    [18, 47.01],
  ];
  var arr_w_10 = [
    [2, 10.9],
    [2.5, 11.85],
    [3, 12.74],
    [3.5, 13.58],
    [4, 14.43],
    [4.5, 15.35],
    [5, 16.33],
    [5.5, 17.26],
    [6, 18.06],
    [6.5, 18.92],
    [7, 20.04],
    [7.5, 21.17],
    [8, 22.24],
    [8.5, 23.28],
    [9, 24.31],
    [9.5, 25.42],
    [10, 26.55],
    [10.5, 27.83],
    [11, 29.33],
    [11.5, 30.97],
    [12, 32.77],
    [12.5, 34.71],
    [13, 37.04],
    [13.5, 39.42],
    [14, 41.8],
    [14.5, 43.94],
    [15, 45.77],
    [15.5, 47.31],
    [16, 48.47],
    [16.5, 49.42],
    [17, 50.11],
    [18, 51.02],
  ];
  var arr_w_25 = [
    [2, 11.65],
    [2.5, 12.66],
    [3, 13.61],
    [3.5, 14.51],
    [4, 15.43],
    [4.5, 16.43],
    [5, 17.52],
    [5.5, 18.56],
    [6, 19.49],
    [6.5, 20.49],
    [7, 21.81],
    [7.5, 23.16],
    [8, 24.46],
    [8.5, 25.73],
    [9, 26.98],
    [9.5, 28.31],
    [10, 29.66],
    [10.5, 31.2],
    [11, 32.97],
    [11.5, 34.91],
    [12, 37.03],
    [12.5, 39.29],
    [13, 41.9],
    [13.5, 44.45],
    [14, 46.9],
    [14.5, 49],
    [15, 50.75],
    [15.5, 52.19],
    [16, 53.26],
    [16.5, 54.13],
    [17, 54.77],
    [18, 55.6],
  ];
  var arr_w_50 = [
    [2, 12.54],
    [2.5, 13.64],
    [3, 14.65],
    [3.5, 15.63],
    [4, 16.64],
    [4.5, 17.75],
    [5, 18.98],
    [5.5, 20.18],
    [6, 21.26],
    [6.5, 22.45],
    [7, 24.06],
    [7.5, 25.72],
    [8, 27.33],
    [8.5, 28.91],
    [9, 30.46],
    [9.5, 32.09],
    [10, 33.74],
    [10.5, 35.58],
    [11, 37.69],
    [11.5, 39.98],
    [12, 42.49],
    [12.5, 45.13],
    [13, 48.08],
    [13.5, 50.85],
    [14, 53.37],
    [14.5, 55.43],
    [15, 57.08],
    [15.5, 58.39],
    [16, 59.35],
    [16.5, 60.12],
    [17, 60.68],
    [18, 61.4],
  ];
  var arr_w_75 = [
    [2, 13.51],
    [2.5, 14.7],
    [3, 15.8],
    [3.5, 16.86],
    [4, 17.98],
    [4.5, 19.22],
    [5, 20.61],
    [5.5, 21.98],
    [6, 23.26],
    [6.5, 24.7],
    [7, 26.66],
    [7.5, 28.7],
    [8, 30.71],
    [8.5, 32.69],
    [9, 34.61],
    [9.5, 36.61],
    [10, 38.61],
    [10.5, 40.81],
    [11, 43.27],
    [11.5, 45.94],
    [12, 48.86],
    [12.5, 51.89],
    [13, 55.21],
    [13.5, 58.21],
    [14, 60.83],
    [14.5, 62.86],
    [15, 64.4],
    [15.5, 65.57],
    [16, 66.4],
    [16.5, 67.05],
    [17, 67.51],
    [18, 68.11],
  ];
  var arr_w_90 = [
    [2, 14.46],
    [2.5, 15.73],
    [3, 16.92],
    [3.5, 18.08],
    [4, 19.29],
    [4.5, 20.67],
    [5, 22.23],
    [5.5, 23.81],
    [6, 25.29],
    [6.5, 27],
    [7, 29.35],
    [7.5, 31.84],
    [8, 34.31],
    [8.5, 36.74],
    [9, 39.08],
    [9.5, 41.49],
    [10, 43.85],
    [10.5, 46.4],
    [11, 49.2],
    [11.5, 52.21],
    [12, 55.5],
    [12.5, 58.9],
    [13, 62.57],
    [13.5, 65.8],
    [14, 68.53],
    [14.5, 70.55],
    [15, 72],
    [15.5, 73.03],
    [16, 73.73],
    [16.5, 74.25],
    [17, 74.62],
    [18, 75.08],
  ];
  var arr_w_97 = [
    [2, 15.46],
    [2.5, 16.83],
    [3, 18.12],
    [3.5, 19.38],
    [4, 20.71],
    [4.5, 22.24],
    [5, 24],
    [5.5, 25.81],
    [6, 27.55],
    [6.5, 29.57],
    [7, 32.41],
    [7.5, 35.45],
    [8, 38.49],
    [8.5, 41.49],
    [9, 44.35],
    [9.5, 47.24],
    [10, 50.01],
    [10.5, 52.93],
    [11, 56.07],
    [11.5, 59.4],
    [12, 63.04],
    [12.5, 66.81],
    [13, 70.83],
    [13.5, 74.33],
    [14, 77.2],
    [14.5, 79.24],
    [15, 80.6],
    [15.5, 81.49],
    [16, 82.05],
    [16.5, 82.44],
    [17, 82.7],
    [18, 83],
  ];

  var m = new muBan(35, 60, 100, 100);
  var c = document.getElementById(myCanvas);
  var ctx = c.getContext('2d');

  m.box(ctx, color, 0.75, 0.2, 17, 68, 15, 150); //画格子
  m.txt(ctx, color, font, a, a, l, r, t, b, 17, 15); //写字
  m.title(ctx, color, font2, title, 17);

  //身高
  m.line(ctx, 218, color, 2, arr_h_3, 11, 80, 10, 2, false, false, '3');
  m.line(ctx, 218, color, 0.5, arr_h_10, 11, 80, 10, 2, false, false, '10');
  m.line(ctx, 218, color, 0.5, arr_h_25, 11, 80, 10, 2, false, false, '25');
  m.line(ctx, 218, color, 2, arr_h_50, 11, 80, 10, 2, false, false, '50');
  m.line(ctx, 218, color, 0.5, arr_h_75, 11, 80, 10, 2, false, false, '75');
  m.line(ctx, 218, color, 0.5, arr_h_90, 11, 80, 10, 2, false, false, '90');
  m.line(ctx, 218, color, 2, arr_h_97, 11, 80, 10, 2, false, false, '97');

  //体重
  m.line(ctx, 218, color, 2, arr_w_3, 13, 10, 10, 2, false, false, '3');
  m.line(ctx, 218, color, 0.5, arr_w_10, 13, 10, 10, 2, false, false, '10');
  m.line(ctx, 218, color, 0.5, arr_w_25, 13, 10, 10, 2, false, false, '25');
  m.line(ctx, 218, color, 2, arr_w_50, 13, 10, 10, 2, false, false, '50');
  m.line(ctx, 218, color, 0.5, arr_w_75, 13, 10, 10, 2, false, false, '75');
  m.line(ctx, 218, color, 0.5, arr_w_90, 13, 10, 10, 2, false, false, '90');
  m.line(ctx, 218, color, 2, arr_w_97, 13, 10, 10, 2, false, false, '97');

  height && m.line(ctx, 218, color_, 1, height, 11, 80, 10, 2, true, false, null); //身高
  weight && m.line(ctx, 218, color_, 1, weight, 13, 10, 10, 2, true, false, null); //体重
};
